<script type="text/javascript">
    function otherVerify(form, msg) {
        //自定义验证规则
        form.verify({
            otherReq: function (value, item) {
                var $ = layui.$;
                    let verifyType = $(item).attr('type')
                    , formElem = $(item).parents('.layui-form')//获取当前所在的form元素，如果存在的话
                    , verifyElem = formElem.find('.otherReq')//获取需要校验的元素
                var isTrue = false;
                verifyElem.each(function (index, item) {
                    if (verifyElem.is(':checked')) {
                        isTrue = true
                    }
                });
                    // var isTrue = verifyElem.is(':checked')//是否命中校验
                    var focusElem = verifyElem.next().find('i.layui-icon');//焦点元素
                if (!isTrue || !value) {
                    //定位焦点
                    focusElem.css(verifyType == 'radio' ? {"color": "#FF5722"} : {"border-color": "#FF5722"});
                    //对非输入框设置焦点
                    focusElem.first().attr("tabIndex", "1").css("outline", "0").blur(function () {
                        focusElem.css(verifyType == 'radio' ? {"color": ""} : {"border-color": ""});
                    }).focus();
                    return msg;
                }
            }
        });
    }


</script>